package Servidor_Socket;


import java.io.IOException;
import java.net.ServerSocket;
import java.util.logging.Level;
import java.util.logging.Logger;


public class Server {

    private ServerSocket server;
    final int PORT = 5000;

    public Server() {
        try {
            server = new ServerSocket(PORT);
            aceptarClientes();
        } catch (IOException ex) {
            Logger.getLogger(Server.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    public void aceptarClientes() {
        while (true) {
            try {
                InnerServer sesion = new InnerServer(server.accept());
                sesion.start();
            } catch (IOException ex) {
                Logger.getLogger(Server.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }

    
    public static void main(String[] args) {
        new Server();
    }
}
